home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / VIS082S.ARJ / BULLETIN.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-04  |  57KB  |  2,063 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,N-,L+,O+ }
  2.  
  3. unit bulletin;               (* Message Section for ViSiON *)
  4.  
  5. interface
  6.  
  7. uses crt,dos,windows,
  8. gentypes,configrt,statret,gensubs,subs1,subs2,
  9. userret,textret,mainr1,mainr2,overret1,flags,mainmenu,mycomman;
  10.  
  11. procedure bulletinmenu;
  12.  
  13. implementation
  14.  
  15. procedure bulletinmenu;
  16. var q,curbul,lastreadnum:integer;
  17.     b:bulrec;
  18.     reading,quitmasterinc,cscan:boolean;
  19.  
  20. procedure readfromtext; forward;
  21.  
  22.   procedure togglecscan;
  23.   begin
  24.    if cscan then cscan:=false else
  25.     cscan:=true;
  26.    writeln;
  27.    write (^R'Auto-Scan is now: '^S);
  28.    if cscan then writeln ('On') else writeln ('Off');
  29.    writeln;
  30.   end;
  31.  
  32.   procedure makeboard; forward;
  33.  
  34.   function sponsoron:boolean;
  35.   begin
  36.     sponsoron:=match(curboard.sponsor,unam)
  37.   end;
  38.  
  39.   procedure clearorder (var bo:boardorder);
  40.   var cnt:integer;
  41.   begin
  42.     for cnt:=0 to 255 do bo[cnt]:=cnt
  43.   end;
  44.  
  45.   procedure carryout (var bo:boardorder);
  46.   var u:userrec;
  47.       cnt,un:integer;
  48.  
  49.     procedure doone;
  50.     var cnt,q:integer;
  51.         ns,a1,a2:set of byte;
  52.     begin
  53.       fillchar (ns,32,0);
  54.       fillchar (a1,32,0);
  55.       fillchar (a2,32,0);
  56.       for cnt:=0 to 255 do begin
  57.         q:=bo[cnt];
  58.         if q in u.newscanconfig then ns:=ns+[cnt];
  59.         if q in u.access1 then a1:=a1+[cnt];
  60.         if q in u.access2 then a2:=a2+[cnt]
  61.       end;
  62.       u.newscanconfig:=ns;
  63.       u.access1:=a1;
  64.       u.access2:=a2;
  65.       seek (ufile,un);
  66.       write (ufile,u)
  67.     end;
  68.  
  69.   begin
  70.     writeln (^B'Now Adjusting the Flags.....');
  71.     seek (ufile,1);
  72.     for un:=1 to numusers do begin
  73.       if (un mod 10)=0 then write (' ',un);
  74.       read (ufile,u);
  75.       if length(u.handle)>0 then doone
  76.     end
  77.   end;
  78.  
  79.   procedure switchboards (bnum1,bnum2:integer; var bo:boardorder);
  80.   var bd1,bd2:boardrec;
  81.       n1:integer;
  82.   begin
  83.     seekbdfile (bnum1);
  84.     read (bdfile,bd1);
  85.     seekbdfile (bnum2);
  86.     read (bdfile,bd2);
  87.     seekbdfile (bnum1);
  88.     writebdfile (bd2);
  89.     seekbdfile (bnum2);
  90.     writebdfile (bd1);
  91.     n1:=bo[bnum1];
  92.     bo[bnum1]:=bo[bnum2];
  93.     bo[bnum2]:=n1
  94.   end;
  95.  
  96.   procedure setfirstboard; forward;
  97.  
  98.  
  99.   procedure seekbfile (n:integer);
  100.   begin
  101.     seek (bfile,n-1); che
  102.   end;
  103.  
  104.  
  105.   function numbuls:integer;
  106.   begin
  107.     numbuls:=filesize(bfile)
  108.   end;
  109.  
  110.   procedure getlastreadnum;
  111.   var oldb:boolean;
  112.       b:bulrec;
  113.       lr:word;
  114.   begin
  115.     lastreadnum:=numbuls;
  116.     oldb:=false;
  117.     lr:=urec.lastread[curboardnum+(50*(CurrentConference-1))];
  118.     if lr=0
  119.       then lastreadnum:=0
  120.       else
  121.         while (lastreadnum>0) and (not oldb) do begin
  122.           seekbfile (lastreadnum);
  123.           read (bfile,b);
  124.           oldb:=b.id=lr;
  125.           if not oldb then lastreadnum:=lastreadnum-1
  126.         end;
  127.         if (lastreadnum=0) then urec.lastread[curboardnum+(50*(currentconference-1))]:=0;
  128.   end;
  129.  
  130.   procedure assignbfile;
  131.   Var S:Mstr;
  132.   begin
  133.   close(bfile);
  134.     S:=ConfigSet.BoardDi+CurBoardName;
  135.     If CurrentConference=1 then S:=S+'.BUL'
  136.        Else
  137.     S:=S+'.BU'+Strr(CurrentConference);
  138.     assign (bfile,s)
  139.   end;
  140.  
  141.   procedure formatbfile;
  142.   begin
  143.     assignbfile;
  144.     rewrite (bfile);
  145.     curboardnum:=searchboard(curboardname);
  146.     if curboardnum=-1 then begin
  147.       curboardnum:=filesize(bdfile);
  148.       fillchar (curboard,sizeof(curboard),0);
  149.       writecurboard
  150.     end
  151.   end;
  152.  
  153.   procedure openbfile;
  154.   var b:bulrec;
  155.       i:integer;
  156.   begin
  157.     curboardnum:=searchboard (curboardname);
  158.     if curboardnum=-1 then begin
  159.       makeboard;
  160.       exit
  161.     end;
  162.     close (bfile);
  163.     assignbfile;
  164.     reset (bfile);
  165.     i:=ioresult;
  166.     if ioresult<>0 then formatbfile;
  167.     seekbdfile (curboardnum);
  168.     read (bdfile,curboard);
  169.     getlastreadnum;
  170.   end;
  171.  
  172.   function boardexist(n:sstr):boolean;
  173.   begin
  174.     boardexist:=not (searchboard(n)=-1)
  175.   end;
  176.  
  177. procedure addbul (var b:bulrec);
  178.   var b2:bulrec;
  179.   begin
  180.     if numbuls=0 then b.id:=1 else begin
  181.       seekbfile (numbuls);
  182.       read (bfile,b2);
  183.       if b2.id=65535
  184.         then b.id:=1
  185.         else b.id:=b2.id+1
  186.     end;
  187.     seekbfile (numbuls+1);
  188.     write (bfile,b);
  189.   end;
  190.  
  191.   function checkcurbul:boolean;
  192.   begin
  193.     if (curbul<1) or (curbul>numbuls) then begin
  194.       checkcurbul:=false;
  195.       curbul:=0
  196.     end else checkcurbul:=true
  197.   end;
  198.  
  199.   procedure getbrec;
  200.   var n:integer;
  201.       u:userrec;
  202.   begin
  203.     if checkcurbul then begin
  204.       seekbfile (curbul);
  205.       read (bfile,b); che;
  206.       n:=lookupuser(b.leftby);
  207.       b.status:='';
  208.       if n>0 then begin
  209.       seek(ufile,n);
  210.       read(ufile,u);
  211.       b.status:='['+u.usernote+']';
  212.       end;
  213.     end
  214.   end;
  215.  
  216.   procedure delbul (bn:integer; deltext:boolean);
  217.   var c,un:integer;
  218.       b:bulrec;
  219.       u:userrec;
  220.   begin
  221.     if (bn<1) or (bn>numbuls) then exit;
  222.     seekbfile (bn);
  223.     read (bfile,b);
  224.     if deltext then deletetext (b.line);
  225.     for c:=bn to numbuls-1 do begin
  226.       seekbfile (c+1);
  227.       read (bfile,b);
  228.       seekbfile (c);
  229.       write (bfile,b)
  230.     end;
  231.     seekbfile (numbuls);
  232.     truncate (bfile);
  233.     getlastreadnum
  234.   end;
  235.  
  236.   procedure delboard (bdn:integer);
  237.   var bd1:boardrec;
  238.       cnt,nbds:integer;
  239.       bo:boardorder;
  240.   begin
  241.     clearorder (bo);
  242.     nbds:=filesize(bdfile)-1;
  243.     if nbds=0 then begin
  244.       close (bdfile);
  245.       rewrite (bdfile);
  246.       exit
  247.     end;
  248.     for cnt:=bdn to nbds-1 do begin
  249.       seekbdfile (cnt+1);
  250.       read (bdfile,bd1);
  251.       seekbdfile (cnt);
  252.       writebdfile (bd1);
  253.       bo[cnt]:=cnt+1
  254.     end;
  255.     seek (bdfile,nbds);
  256.     truncate (bdfile);
  257.     seek (bifile,nbds);
  258.     truncate (bifile);
  259.     carryout (bo)
  260.   end;
  261.  
  262.  
  263.   procedure getbnum (txt:mstr);
  264.   var q:boolean;
  265.   begin
  266.     if length(input)>1
  267.       then curbul:=valu(copy(input,2,255))
  268.       else begin
  269.         writestr (^M'Message to '+txt+':');
  270.         curbul:=valu(input)
  271.       end;
  272.     q:=checkcurbul
  273.   end;
  274.  
  275. procedure killbul;
  276.   var un:integer;
  277.       u:userrec;
  278.   begin
  279.     writehdr ('Message Deletion');
  280.     if not reading then
  281.     getbnum ('delete');
  282.     if not checkcurbul then exit;
  283.     getbrec;
  284.     if (not match(b.leftby,unam)) and (not issysop) and (not sponsoron)
  285.       then begin
  286.         writeln ('Hey You didnt post that!');
  287.         exit
  288.       end;
  289.     writeln ('Subject: ',b.title,
  290.            ^M'Left by: ',b.leftby,^M^M);
  291.     writestr ('Delete this? *');
  292.     if not yes then exit;
  293.     un:=lookupuser (b.leftby);
  294.     if un<>0 then begin
  295.       writeurec;
  296.       seek (ufile,un);
  297.       read (ufile,u);
  298.       u.nbu:=u.nbu-1;
  299.       seek (ufile,un);
  300.       write (ufile,u);
  301.       readurec
  302.     end;
  303.     delbul (curbul,true);
  304.     writeln ('Message deleted.');
  305.     writelog (4,5,b.title)
  306.   end;
  307.  
  308.   procedure autodelete;
  309.   var c,un,bn,cnt:integer;
  310.       B:bulrec;
  311.       u:userrec;
  312.   begin
  313.     bn:=2;
  314.     if (bn<1) or (bn>numbuls) then exit;
  315.     writeln (^R^A'Please wait... Deleting first 5 messages..');
  316.     for cnt:=6 downto 2 do begin
  317.      {delbul (cnt,true) }
  318.     seekbfile(cnt);
  319.     read(bfile,b);
  320.     deletetext(b.line);
  321.     end;
  322.     for c:=bn to numbuls-5 do begin
  323.     seekbfile(c+5);
  324.     read(bfile,b);
  325.     seekbfile(c);
  326.     write(bfile,b);
  327.     end;
  328.     seekbfile(numbuls-4);
  329.     truncate(bfile);
  330.     getlastreadnum;
  331.     end;
  332.  
  333.  
  334.  
  335.   function wipe(amount:byte):string;
  336.   var z:integer;
  337.       gee:string[80];
  338.    begin
  339.    for z:=1 to amount do gee:=gee+' ';
  340.    wipe:=gee;
  341.    end;
  342.  
  343.   procedure postbul;
  344.   var l:integer;
  345.       m:message;
  346.       b:bulrec;
  347.       ds:longint;
  348.   begin
  349.     if ulvl<configset.postleve then begin
  350.       reqlevel(configset.postleve);
  351.       exit
  352.     end;
  353.     l:=editor(m,true,true,'0','0');
  354.     if l>=0 then
  355.       begin
  356.         inc(urec.nbu);
  357.         writeurec;
  358.         b.Where:=Configset.Origin1;
  359.         B.Where2:=Configset.Origin2;
  360.         B.Version:=NetMailVer;
  361.         B.Cnet:=False;
  362.         B.FidoNet:=False;
  363.         B.Flag3:=False;
  364.         B.Flag4:=False;
  365.         B.Flag5:=False;
  366.         B.Flag6:=False;
  367.         B.Flag7:=False;
  368.         B.Flag8:=False;
  369.         B.RealName:=Urec.RealName;
  370.         b.anon:=m.anon;
  371.         b.title:=m.title;
  372.         b.when:=now;
  373.         b.leftby:=unam;
  374.         b.status:='[ ha ]';
  375.         b.recieved:=false;
  376.         b.leftto:=m.sendto;
  377.         b.line:=l;
  378.         b.plevel:=ulvl;
  379.         addbul (b);
  380.         inc(newposts);
  381.         inc(gnup);
  382.         with curboard do
  383.           if autodel<=numbuls then autodelete
  384.       end
  385.   end;
  386.  
  387.   procedure readcurbul;
  388.   var q:anystr;
  389.       t:sstr;
  390.       cnt,emusux,anarkyamerika:integer;
  391.       oligarch:mstr;
  392.   begin
  393.     q:=wipe(80);
  394.     if checkcurbul then begin
  395.      getbrec;
  396.      If (ansigraphics in urec.config) and (urec.msgheader=2) then begin
  397.       clearscr;
  398.       WriteLn(^O'╒══['^P'Msg'^O' -       ═════════════════════════════['^P'When:'^O'       ══════════════════╕');
  399.       oligarch:=^S+strr(curbul)+' of '+strr(numbuls)+^O']';
  400.       printxy(1,11,oligarch+^M);
  401.       WriteLn(^O'│'^P' Title'^O':'^P'                               To'^O':                                  │');
  402.       if issysop or (not b.anon) then
  403.       printxy(1,53,^S+datestr(b.when)+^R' at '^S+timestr(b.when)+^O']');
  404.       printxy(2,10,^S+b.title);
  405.       printxy(2,44,^S+b.leftto+^M);
  406.       WriteLn(^O'│'^P' From'^O' :                                                                    '^O'│');
  407.       q:='';
  408.       if b.anon then
  409.           begin
  410.             q:=q+configset.anonymousst;
  411.             if (issysop) or (ulvl>=configset.sysopleve) then q:=q+' ['+^A+b.leftby+^S+']'
  412.           end
  413.         else
  414.           begin
  415.             if b.plevel=-1
  416.               then t:='unknown'
  417.               else t:=strr(b.plevel);
  418.            q:=q+b.leftby+' '^S'(Level '^P+t+^S') '+b.status;
  419.           end;
  420.       printxy(3,10,q+^M);
  421.       WriteLn(^O'╘═══════════════════════════════════════════════════════════════════════════╛');
  422.       EnD Else Begin
  423.       clearscr;
  424.       Writeln(^A'Sub-Board'^R': '^S,curboard.boardname);
  425.       write   (^B^M^A'['^F'Message'^A']'^R': '^S);
  426.       oligarch:=^S+strr(curbul)+' '^S' of '+strr(numbuls);
  427.       writeln (oligarch);
  428.       writeln (^A'['^F'When'^A'   ]'^R': '^S,datestr(b.when),' at ',timestr(b.when),^R);
  429.       writeln (^A'['^F'Subject'^A']'^R': '^S,b.title);
  430.       write   (^A'['^F'To'^A'     ]'^R': '^S,b.leftto);
  431.       if (b.recieved) then begin
  432.       for anarkyamerika:=1 to 25-(length(b.leftto)+3) do
  433.       write (' ');
  434.        write (^R'['^A'Received'^R']'^R);
  435.        end;
  436.        writeln;
  437.       q:=^A'['^F'From'^A'   ]'^R': '^S;
  438.       if b.anon then
  439.       begin
  440.       q:=q+configset.anonymousst;
  441.       if (issysop) or (ulvl>=configset.sysopleve) then q:=q+' ['+^A+b.leftby+^S+']'
  442.       end
  443.       else
  444.       begin
  445.       if b.plevel=-1
  446.       then t:='unknown'
  447.       else t:=strr(b.plevel);
  448.       q:=q+b.leftby;
  449.            if urec.level>=b.plevel then q:=q+' '+^R+'['^S'Level '+^F+t+^R+'] '+^S else q:=q+' <Classified> ';
  450.        q:=q+b.status;
  451.        end;
  452.        writeln (q);
  453.       End;
  454.       ansicolor(urec.regularcolor);
  455.       if break then exit;
  456.       printtext (b.line);
  457.       If Curboard.Echo>0 then WriteLn(^P'['^A'Net Origin: '+B.Where+^P']'^M'['^A+B.Where2+^P']'^M);
  458.       if match (b.leftto,unam) then begin
  459.        b.recieved:=true;
  460.        seekbfile (curbul);
  461.        write (bfile,b);
  462.       end;
  463.       ansicolor (urec.regularcolor);
  464.     end;
  465.     begin
  466.       if (urec.lastread[curboardnum+(50*(currentconference-1))]<=b.id) or (curbul>=lastreadnum) then
  467.       urec.lastread[curboardnum+(50*(CurrentConference-1))]:=b.id;
  468.       if lastreadnum<curbul then lastreadnum:=curbul;
  469.     end
  470.   end;
  471.  
  472.   function queryaccess:accesstype;
  473.   begin
  474.     queryaccess:=getuseraccflag (urec,curboardnum)
  475.   end;
  476.  
  477.   procedure readbul;
  478.   begin
  479.     getbnum ('Read');
  480.     readcurbul
  481.   end;
  482.  
  483.   procedure readnextbul;
  484.   var t:integer;
  485.   begin
  486.     t:=curbul;
  487.     inc(curbul);
  488.     readcurbul;
  489.     if curbul=0 then curbul:=t
  490.   end;
  491.  
  492.   procedure readnum (n:integer);
  493.   begin
  494.     curbul:=n;
  495.     readcurbul
  496.   end;
  497.  
  498.   function haveaccess (n:integer):boolean;
  499.   var a:accesstype;
  500.   begin
  501.     curboardnum:=n;
  502.     seekbdfile (n);
  503.     read (bdfile,curboard);
  504.     a:=queryaccess;
  505.     if curboard.conference>0 then begin
  506.        haveaccess:=false;
  507.        if urec.confset[curboard.conference]>0 then haveaccess:=true;
  508.      exit;
  509.     end;
  510.     if a=bylevel
  511.       then haveaccess:=ulvl>=curboard.level
  512.       else haveaccess:=a=letin
  513.   end;
  514.  
  515.   procedure makeboard;
  516.   begin
  517.     formatbfile;
  518.     If FileSize(BDfile)=51 then Begin
  519.        WriteLn('You may not have more then 51 message areas per conference!');
  520.        Exit;
  521.     End;
  522.     with curboard do begin
  523.       shortname:=curboardname;
  524.       WriteHdr('Creating Sub-Board: '+shortname);
  525.       buflen:=30;
  526.       writestr (^M^R'Board Name'^A': &');
  527.       boardname:=input;
  528.       buflen:=30;
  529.       writestr (^R'Sponsor '^F'['^S'CR/'+unam+^F']'^A':');
  530.       if input='' then input:=unam;
  531.       sponsor:=input;
  532.       writestr(^R'Area Flag '^F'('^S'1-30'^F') ['^S'CR/None'^F']'^A':');
  533.       if input='' then input:='0';
  534.       conference:=valu(input);
  535.       writestr (^R'Minimum Level for entry'^A':');
  536.       level:=valu(input);
  537.       writestr (^R'Autodelete after '^F'['^S'CR/100'^F']'^A':');
  538.       if length(input)<1 then input:='100';
  539.       autodel:=valu(input);
  540.       if autodel<10 then begin
  541.         writeln ('Must be at least 10!');
  542.         autodel:=10
  543.       end;
  544.       WriteStr(^R'Is this a Net-Mail Sub? '^F'['^S'N'^F']'^A':*');
  545.         If yes then begin
  546.       WriteStr(^R'EchoMail ID Number '^F'('^S'0=None'^F') ['^S'0'^F']'^A':');
  547.       if Input='' then input:='0';
  548.       echo:=Valu(Input);
  549.         end else echo:=0;
  550.       setallflags (curboardnum,bylevel);
  551.       writecurboard;
  552.       writeln (^M^U'Board created!');
  553.       writelog (4,4,boardname+' ['+shortname+']')
  554.     end
  555.   end;
  556.  
  557.   Procedure Sdw;
  558.   Begin
  559.   ansicolor(8);
  560.   WriteLn('█');
  561.   end;
  562.  
  563.  procedure setactive (nn:sstr);
  564.  
  565.     procedure doswitch;
  566.     begin
  567.       openbfile;
  568.       curbul:=lastreadnum;
  569.       with curboard do
  570.      begin
  571.       curbul:=lastreadnum;
  572.       with curboard do
  573.       if not (ansigraphics in urec.config) then  writeln (^M'Sub-board: '^S,boardname,
  574.                  ^M'Sponsor:   '^S,sponsor,
  575.                  ^M'Bulletins: '^S,numbuls,
  576.                  ^M'Last read: '^S,lastreadnum,^M)
  577.            else begin
  578.                 clearscr;
  579. writeln(^R'                      ╒═════════════════════════════════════╕');
  580. write(^R'                      │'^P' Sub:                              '^R'  │');sdw;
  581. write(^R'                      ╘═════════════════════════════════════╛');sdw;
  582. write(^R'                      ╒═════════════════════════════════════╕');sdw;
  583. write(^R'                      │'^P' Messages'^A'....'^R'                        │');sdw;
  584. write(^R'                      │'^P' Last Read'^A'...'^R'                        │');sdw;
  585. write(^R'                      │'^P' Sponsor'^A'.....'^R'                        │');sdw;
  586. write(^R'                      │'^P' Posts by You'^R'                        │');sdw;
  587. write(^R'                      │'^P' Date/Time'^A'...'^R'                        │');sdw;
  588. write(^R'                      ╘═════════════════════════════════════╛');sdw;ANSiColoR(8);
  589. WriteLn('                         ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀');ANsiColor(urec.regularcolor);
  590. printxy(2,30,curboard.boardname);
  591. printxy(5,38,strr(numbuls));
  592. printxy(6,38,strr(lastreadnum));
  593. printxy(7,38,Curboard.sponsor);
  594. printxy(8,38,strr(urec.nbu));
  595. PrintXy(9,38,DateStr(Now)+' - '+TimeStr(Now)+^M^M^M);
  596. End;
  597. end;
  598. End;
  599.  
  600.  
  601.  
  602.     procedure tryswitch;
  603.     var n,s:integer;
  604.  
  605.       procedure denyaccess;
  606.       var b:bulrec;
  607.       begin
  608.         writeln(^M^P'Invalid Board!'^G);
  609.         setfirstboard
  610.       end;
  611.  
  612.     begin
  613.       curboardname:=nn;
  614.       curboardnum:=searchboard(nn);
  615.       if haveaccess(curboardnum)
  616.         then doswitch
  617.         else denyaccess
  618.     end;
  619.  
  620.   var b:bulrec;
  621.   begin
  622.     curbul:=0;
  623.     close (bfile);
  624.     curboardname:=nn;
  625.     if boardexist(nn) then tryswitch else begin
  626.       writeln ('No such board: ',curboardname,'!');
  627.       if issysop
  628.         then
  629.           begin
  630.             writestr (^M'Create one [y/n]? *');
  631.             if yes
  632.               then
  633.                 begin
  634.                   makeboard;
  635.                   setactive (curboardname)
  636.                 end
  637.               else setfirstboard
  638.           end
  639.         else setfirstboard
  640.     end
  641.   end;
  642.  
  643.   function validbname (n:sstr):boolean;
  644.   var cnt:integer;
  645.   begin
  646.     validbname:=false;
  647.     if (length(n)=0) or (length(n)>8) then exit;
  648.     for cnt:=1 to length(n) do
  649.       if not (upcase(n[cnt]) in ['0'..'9','A'..'Z']) then exit;
  650.     validbname:=true
  651.   end;
  652.  
  653.   procedure listboards;
  654.   var cnt,oldcurboard:integer;
  655.       printed:boolean;
  656.   begin
  657.     oldcurboard:=curboardnum;
  658.     clearscr;writehdr(' Message Areas ');
  659.    writeln(^R'╒═════════════════════════════════════════════════════════════╕');
  660.    writeln(^R'│ '^P'Number      Sub-Board Name                 Level/Conference'^R' │');
  661.    writeln(^R'╞═════════════════════════════════════════════════════════════╡');
  662.     if break then exit;
  663.     for cnt:=0 to filesize(bdfile)-1 do
  664.       if haveaccess(cnt) then
  665.         with curboard do begin
  666.         write(^R'│ ');
  667.           tab (^U+shortname,11); write('  ');
  668.           tab (^A+boardname,31); write('  ');
  669.           if (conference>0) then tab(^R'Conference '^S+strr(conference),18) else
  670.           tab(^S+strr(level),17);
  671.            writeln(^R'│');
  672.           if break then exit
  673.         end;
  674.    writeln(^R'╘═════════════════════════════════════════════════════════════╛'^M);
  675.     curboardnum:=oldcurboard;
  676.     seekbdfile (curboardnum);
  677.     read (bdfile,curboard)
  678.   end;
  679.  
  680.  
  681.   procedure activeboard;
  682.   begin
  683.     if length(input)>1
  684.       then input:=copy(input,2,255)
  685.       else begin
  686.         listboards;
  687.         repeat
  688.           writestr (^M^M^P'Board Number '^S'['^F'?'^A'/'^F'List'^S']'^P':');
  689.           if input='?' then listboards
  690.         until (input<>'?') or hungupon;
  691.       end;
  692.     if hungupon or (length(input)=0) then exit;
  693.     if input[1]='*' then input:=copy(input,2,255);
  694.     if validbname(input)
  695.       then setactive (input)
  696.       else
  697.         begin
  698.           writeln (^M'Invalid board name!');
  699.           setfirstboard
  700.         end
  701.   end;
  702.  
  703.   procedure setfirstboard; { FORWARD }
  704.   var fbn:sstr;
  705.   begin
  706.     if filesize(bdfile)=0 then exit;
  707.     if not haveaccess(0)
  708.       then error ('Sorry user cannot access first sub board!','','');
  709.     seek (bifile,0);
  710.     read (bifile,fbn);
  711.     setactive (fbn)
  712.   end;
  713.  
  714.   procedure listbuls;
  715.   var cnt,bn:integer;
  716.       q:boolean;
  717.   begin
  718.     if length(input)>1 then begin
  719.       curbul:=valu(copy(input,2,255));
  720.       q:=checkcurbul
  721.     end;
  722.     if curbul=0
  723.       then
  724.         begin
  725.           writestr (^M'List titles starting at #*');
  726.           curbul:=valu(input)
  727.         end
  728.       else
  729.         if length(input)>1
  730.           then curbul:=valu(input)
  731.           else curbul:=curbul+10;
  732.     if not checkcurbul then curbul:=1;
  733.     writeln ('Titles:'^M);
  734.     for cnt:=0 to 9 do
  735.       begin
  736.         bn:=curbul+cnt;
  737.         if (bn>0) and (bn<=numbuls) then
  738.           begin
  739.             seekbfile (bn);
  740.             read (bfile,b);
  741.             write (bn,'. '^S,b.title,^R' by ');
  742.             if b.anon
  743.               then writeln (configset.anonymousst)
  744.               else writeln (b.leftby);
  745.             if break then exit
  746.           end
  747.       end
  748.   end;
  749.  
  750.   procedure editbul;
  751.   var me:message;
  752.   begin
  753.     getbnum ('edit');
  754.     if not checkcurbul then exit;
  755.     getbrec;
  756.     if (not match(b.leftby,unam)) and (not issysop) and (not sponsoron)
  757.       then begin
  758.         writeln ('You can not edit a message you didn''t post!');
  759.         exit
  760.       end;
  761.     reloadtext (b.line,me);
  762.     me.title:=b.title;
  763.     me.anon:=b.anon;
  764.     me.sendto:=b.leftto;
  765.     if reedit (me,true) then begin
  766.       writelog (4,6,b.title);
  767.       deletetext (b.line);
  768.       b.line:=maketext (me);
  769.       if b.line<0 then begin
  770.         writestr (^M'Deleting bulletin...');
  771.         delbul (curbul,false)
  772.       end else begin
  773.         seekbfile (curbul);
  774.         write (bfile,b)
  775.       end
  776.     end
  777.   end;
  778.  
  779.  
  780.   procedure sendbreply;
  781.   begin
  782.     if checkcurbul then begin
  783.       getbrec;
  784.       sendmailto (b.leftby,b.anon)
  785.     end else begin
  786.       getbnum ('reply to');
  787.       if checkcurbul then sendbreply
  788.     end
  789.   end;
  790.  
  791. procedure uploadfile;
  792.   var f:text;
  793.       b:bulrec;
  794.       me:message;
  795.       tu:mstr;
  796.       sub,ls:lstr;
  797.       lne:integer;
  798.   begin
  799.     writeln(^M^S'Message Upload Via Z-Modem.'^M);
  800.     writestr(^M^P'Subject'^A':*');
  801.     if input='' then exit;
  802.     sub:=input;
  803.     writestr(^R'Post to ['^A'CR'^R'/'^S'All'^R']:*');
  804.     if input='' then input:='All';
  805.     tu:=input;
  806.     writeln(^M^S'Ready to receive via Z-Modem Upload!');
  807.     assign(f,configset.forumdi+'Message.Xyz');
  808.     if exist(configset.forumdi+'Message.Xyz') then erase(f);
  809.     delay(500);
  810.     exec('DSZ.COM',' port '+strlong(configset.useco)+' speed '+strlong(baudrate)+' rz '+configset.forumdi+'Message.Xyz');
  811.     if dosexitcode<>0 then begin
  812.        writeln(^G^G'Aborted!');
  813.        if exist(configset.forumdi+'Message.Xyz') then erase(f);
  814.        exit;
  815.     end;
  816.     lne:=0;
  817.     reset(f);
  818.     while not eof(f) do begin
  819.       readln(f,ls);
  820.       inc(lne);
  821.       if lne>100 then begin
  822.         Writeln(^G^G^G^S'You may NOT have more then 100 lines in a message!');
  823.         textclose(f);
  824.         erase(f);
  825.         exit;
  826.       end;
  827.       me.text[lne]:=ls;
  828.     end;
  829.     me.anon:=false;
  830.     me.numlines:=lne;
  831.     me.sendto:=tu;
  832.     me.note:=urec.usernote;
  833.     lne:=maketext(me);
  834.     b.anon:=false;
  835.     b.title:=sub;
  836.     B.Where:=Configset.origin1;
  837.     B.Where2:=Configset.origin2;
  838.     B.Version:=NetMailVer;
  839.     B.Cnet:=False;
  840.     B.FidoNet:=False;
  841.     B.Flag3:=False;
  842.     B.Flag4:=False;
  843.     B.Flag5:=False;
  844.     B.Flag6:=False;
  845.     B.Flag7:=False;
  846.     B.Flag8:=False;
  847.     B.RealName:=Urec.RealName;
  848.     b.when:=now;
  849.     b.leftby:=unam;
  850.     b.status:='[ ha ]';
  851.     b.recieved:=false;
  852.     b.leftto:=tu;
  853.     b.line:=lne;
  854.     b.plevel:=ulvl;
  855.     addbul(b);
  856.     inc(newposts);
  857.     inc(gnup);
  858.     with curboard do if autodel<=numbuls then autodelete;
  859.     writeln(^M^S'Message posted!');
  860.   end;
  861.  
  862.   procedure boardsponsor;
  863.  
  864.     procedure getbgen (txt:mstr; var q);
  865.     var s:lstr absolute q;
  866.     begin
  867.       writeln (^B'Current ',txt,': ',s);
  868.       buflen:=30;
  869.       writestr ('Enter new '+txt+': &');
  870.       if length(input)>0 then s:=input
  871.     end;
  872.  
  873.     procedure getbint (txt:mstr; var i:integer);
  874.     var a:anystr;
  875.     begin
  876.       a:=strr(i);
  877.       getbgen (txt,a);
  878.       i:=valu(a);
  879.       writecurboard
  880.     end;
  881.  
  882.     procedure getbstr (txt:mstr; var q);
  883.     begin
  884.       getbgen (txt,q);
  885.       writecurboard
  886.     end;
  887.  
  888.     procedure setacc (ac:accesstype; un:integer);
  889.     var u:userrec;
  890.     begin
  891.       seek (ufile,un);
  892.       read (ufile,u);
  893.       setuseraccflag (u,curboardnum,ac);
  894.       seek (ufile,un);
  895.       write (ufile,u)
  896.     end;
  897.  
  898.     function queryacc (un:integer):accesstype;
  899.     var u:userrec;
  900.     begin
  901.       seek (ufile,un);
  902.       read (ufile,u);
  903.       queryacc:=getuseraccflag (u,curboardnum)
  904.     end;
  905.  
  906.     procedure setnameaccess;
  907.     var un,n:integer;
  908.         ac:accesstype;
  909.         q,unm:mstr;
  910.     begin
  911.       writestr (^M'Change Access for User:');
  912.       un:=lookupuser(input);
  913.       if un=0 then begin
  914.         writeln ('No such user!');
  915.         exit
  916.       end;
  917.       unm:=input;
  918.       ac:=queryacc(un);
  919.       writeln (^B^M'Current access: ',accessstr[ac]);
  920.       getacflag (ac,q);
  921.       if ac=invalid then exit;
  922.       if un=unum then writeurec;
  923.       setacc (ac,un);
  924.       if un=unum then readurec;
  925.       case ac of
  926.         letin:n:=1;
  927.         keepout:n:=2;
  928.         bylevel:n:=3
  929.       end;
  930.       writelog (5,n,unm)
  931.     end;
  932.  
  933.     procedure setallaccess;
  934.     var cnt:integer;
  935.         ac:accesstype;
  936.         q:mstr;
  937.     begin
  938.       writehdr ('Set Everyone''s Access');
  939.       getacflag (ac,q);
  940.       if ac=invalid then exit;
  941.       writeurec;
  942.       setallflags (curboardnum,ac);
  943.       readurec;
  944.       writeln ('Done.');
  945.       writelog (5,4,accessstr[ac])
  946.     end;
  947.  
  948.     procedure listaccess;
  949.  
  950.       procedure listacc (all:boolean);
  951.       var cnt:integer;
  952.           a:accesstype;
  953.           u:userrec;
  954.  
  955.         procedure writeuser;
  956.         begin
  957.           if all
  958.             then
  959.               begin
  960.                 tab (u.handle,30);
  961.                 if a=bylevel
  962.                   then writeln ('Level='+strr(u.level))
  963.                   else writeln ('Let in')
  964.               end
  965.             else writeln (u.handle)
  966.         end;
  967.  
  968.       begin
  969.         seek (ufile,1);
  970.         for cnt:=1 to numusers do begin
  971.           read (ufile,u);
  972.           if curboard.conference=0 then Begin
  973.           a:=getuseraccflag (u,curboardnum);
  974.           case a of
  975.             letin:writeuser;
  976.             bylevel:if all and (u.level>=curboard.level) then writeuser
  977.           end;
  978.           end Else If U.ConfSet[Curboard.Conference]>0 then WriteUser;
  979.           if break then exit
  980.         end
  981.       end;
  982.  
  983.     begin
  984.       writestr (
  985. 'List [A]ll users who have access, or only those with [S]pecial access? *');
  986.       if length(input)=0 then exit;
  987.       case upcase(input[1]) of
  988.         'A':listacc (true);
  989.         'S':listacc (false)
  990.       end
  991.     end;
  992.  
  993.     procedure getblevel;
  994.     var b:bulrec;
  995.     begin
  996.       getbint ('level',curboard.level);
  997.       writelog (5,12,strr(curboard.level))
  998.     end;
  999.  
  1000.    procedure setanon;
  1001.    var b:bulrec;
  1002.    begin
  1003.      writestr ('Which Conference [0]: *');
  1004.      if input='' then input:='0';
  1005.      curboard.conference:=valu(input);
  1006.      writecurboard;
  1007.    end;
  1008.  
  1009.    procedure getautodel;
  1010.     var b:bulrec;
  1011.     begin
  1012.       with curboard do begin
  1013.         getbint ('auto-delete',autodel);
  1014.         if autodel<10
  1015.           then
  1016.             begin
  1017.               writeln (^B'HEY!  It can''t be less than ten!');
  1018.               autodel:=numbuls+1;
  1019.               if autodel<10 then autodel:=10;
  1020.               writeln (^B'Setting autodelete to ',autodel);
  1021.               writecurboard
  1022.             end
  1023.           else
  1024.             if autodel<=numbuls
  1025.               then
  1026.                 begin
  1027.                   writeln (^B'Deleting bulletins...');
  1028.                   while autodel<=numbuls do delbul (2,true)
  1029.                 end
  1030.       end;
  1031.       writelog (5,11,strr(curboard.autodel))
  1032.     end;
  1033.  
  1034.  
  1035.     procedure movebulletin;
  1036.     var b:bulrec;
  1037.         tcb:boardrec;
  1038.         tcbn,dbn,bnum:integer;
  1039.         tcbname,dbname:sstr;
  1040.     begin
  1041.       writehdr ('Message Move');
  1042.       getbnum ('move');
  1043.       if not checkcurbul then exit;
  1044.       bnum:=curbul;
  1045.       seekbfile (bnum);
  1046.       read (bfile,b);
  1047.       writestr ('Move "'+b.title+'" posted by '+b.leftby+
  1048.         ' to which board? *');
  1049.       if length(input)=0 then exit;
  1050.       tcbname:=curboardname;
  1051.       dbname:=input;
  1052.       dbn:=searchboard(dbname);
  1053.       if dbn=-1 then begin
  1054.         writeln ('No such board!');
  1055.         exit
  1056.       end;
  1057.       writeln ('Moving...');
  1058.       delbul (bnum,false);
  1059.       close (bfile);
  1060.       curboardname:=dbname;
  1061.       openbfile;
  1062.       addbul (b);
  1063.       close (bfile);
  1064.       curboardname:=tcbname;
  1065.       openbfile;
  1066.       writelog (5,13,b.title);
  1067.       writeln (^B'Done!')
  1068.     end;
  1069.  
  1070.  
  1071.     procedure setsponsor;
  1072.     var un:integer;
  1073.         b:bulrec;
  1074.     begin
  1075.       writestr ('New sponsor:');
  1076.       if length(input)=0 then exit;
  1077.       un:=lookupuser (input);
  1078.       if un=0
  1079.         then writeln ('No such user.')
  1080.         else
  1081.           begin
  1082.             curboard.sponsor:=input;
  1083.             writelog (5,8,input);
  1084.             writecurboard
  1085.           end
  1086.     end;
  1087.  
  1088.     procedure renameboard;
  1089.     var sn:sstr;
  1090.         nfp,nbf,nff:lstr;
  1091.         qf:file;
  1092.        q,d:integer;
  1093.     begin
  1094.      repeat
  1095.             clearscr;
  1096.             sn:=curboard.shortname;
  1097.             writehdr('Sub-Board Rename');
  1098.             writeln(^R'1) Area Name            : '^S,curboard.boardname);
  1099.             writeln(^R'2) Echo Mail Conference : '^S,Curboard.Echo);
  1100.             write(^R'3) Area Flag Number     : '^S); if curboard.conference=0 then writeln('None') else
  1101.             writeln(curboard.conference);
  1102.             writeln(^R'4) Access Level         : '^S,curboard.level);
  1103.             writeln(^R'5) Access Name/Number   : '^S,curboard.shortname);
  1104.             writeln(^R'6) Maximum messages     : '^S,curboard.autodel);
  1105.             writeln(^R'7) Sponsor              : '^S,curboard.sponsor);
  1106.             writestr(^M'Number to change or [X] to exit : [X]:');
  1107.             if match(input,'X') or (input='') then input:='100';
  1108.             q:=valu(input);
  1109.             case q of
  1110.             1:begin getbstr ('Board Name',curboard.boardname);
  1111.                     sn:=curboard.shortname;
  1112.                     end;
  1113.             2:begin
  1114.                    WriteStr(^M'Echo Conference (0=None): [0]:');
  1115.                    if input='' then input:='0';
  1116.                    Curboard.Echo:=Valu(Input);
  1117.                end;
  1118.             3:begin
  1119.                   writestr(^M'Current Conference :'+strr(curboard.conference)+^M'New conference, [Ret=No Change]:');
  1120.                   if input='' then input:=strr(curboard.conference);
  1121.                   curboard.conference:=valu(input);
  1122.                   end;
  1123.             6:getautodel;
  1124.             7:setsponsor;
  1125.             4:begin
  1126.                     writestr(^M'Current Access Level :'+strr(curboard.level)+^M'New Level [Ret=No Change]:');
  1127.                     if input='' then input:=strr(curboard.level);
  1128.                     curboard.level:=valu(input);
  1129.                     end;
  1130.             5:begin
  1131.                   writeln;
  1132.                    getbgen ('Access Name/Number',sn);
  1133.                    writelog (5,5,curboard.boardname+' ['+sn+']');
  1134.                    if not validbname(sn) then begin
  1135.                    writeln ('Invalid board name!');
  1136.                    end else
  1137.                    if boardexist(sn) then begin
  1138.                     writeln ('Sorry!  Board already exists!');
  1139.                     end else
  1140.                     curboard.shortname:=sn;
  1141.             end;
  1142.      end
  1143.      until (q=100) or hungupon;
  1144.       writecurboard;
  1145.       close (bfile);
  1146.       nfp:=configset.boarddi+curboard.shortname+'.';
  1147.       If CurrentConference=1 then nbf:=nfp+'BUL'
  1148.       Else
  1149.         Nbf:=Nfp+'BU'+Strr(CurrentConference);
  1150.       if not exist(nbf) then
  1151.       rename (bfile,nbf);
  1152.       close(bfile); assign(bfile,nbf); reset(bfile);
  1153.       q:=9
  1154.     end;
  1155.  
  1156.     procedure killboard;
  1157.     var cnt:integer;
  1158.         f:file;
  1159.         bd:boardrec;
  1160.     begin
  1161.       writestr ('Kill Board - You sure [y/n]? *');
  1162.       if not yes then exit;
  1163.       writelog (5,10,'');
  1164.       writeln (^B^M'Deleting messages...');
  1165.       for cnt:=numbuls downto 1 do
  1166.         begin
  1167.           delbul(cnt,true);
  1168.           write (cnt,' ');
  1169.         end;
  1170.       writeln (^B^M'Deleting sub-board files...');
  1171.       close (bfile);
  1172.       assignbfile;
  1173.       erase (bfile);
  1174.       if ioresult<>0 then writeln (^B'Error erasing board file.');
  1175.       writeln (^M'Removing sub-board...');
  1176.       delboard (curboardnum);
  1177.       writeln (^B'Sub-board erased!');
  1178.       setfirstboard;
  1179.       q:=9
  1180.     end;
  1181.  
  1182.     procedure sortboards;
  1183.     var cnt,mark,temp:integer;
  1184.         bd1,bd2:boardrec;
  1185.         bn1,bn2:sstr;
  1186.         bo:boardorder;
  1187.     begin
  1188.       writestr ('Sort sub-boards: Are you sure? *');
  1189.       if not yes then exit;
  1190.       clearorder (bo);
  1191.       mark:=filesize(bdfile)-1;
  1192.       repeat
  1193.         if mark<>0 then begin
  1194.           temp:=mark;
  1195.           mark:=0;
  1196.           for cnt:=0 to temp-1 do begin
  1197.             seek (bifile,cnt);
  1198.             read (bifile,bn1);
  1199.             read (bifile,bn2);
  1200.             if upstring(bn1)>upstring(bn2) then begin
  1201.               mark:=cnt;
  1202.               switchboards (cnt,cnt+1,bo)
  1203.             end
  1204.           end
  1205.         end
  1206.       until mark=0;
  1207.       carryout (bo);
  1208.       writelog (5,16,'');
  1209.       setfirstboard;
  1210.       q:=9
  1211.     end;
  1212.  
  1213.     procedure orderboards;
  1214.     var numb,curb,newb:integer;
  1215.         bo:boardorder;
  1216.      label exit;
  1217.  
  1218.     begin
  1219.       clearorder (bo);
  1220.       writehdr ('Re-order sub-boards');
  1221.       numb:=filesize (bdfile);
  1222.       thereare (numb,'sub-board','sub-boards');
  1223.       for curb:=0 to numb-2 do begin
  1224.         repeat
  1225.           writestr ('New Board #'+strr(curb+1)+' [?/List, CR/Quit]:');
  1226.           if length(input)=0 then goto exit;
  1227.           if input='?'
  1228.             then
  1229.               begin
  1230.                 listboards;
  1231.                 newb:=-1
  1232.               end
  1233.             else
  1234.               begin
  1235.                 newb:=searchboard(input);
  1236.                 if newb<0 then writeln ('Not found!  Please re-enter...')
  1237.               end
  1238.         until (newb>=0);
  1239.         switchboards (curb,newb,bo)
  1240.       end;
  1241.       exit:
  1242.       carryout (bo);
  1243.       writelog (5,14,'');
  1244.       q:=9;
  1245.       setfirstboard
  1246.     end;
  1247.  
  1248.   begin
  1249.     if (not sponsoron) and (not issysop) then begin
  1250.             writeln ('Nice try, but you aren''t the sponsor.');
  1251.             inc(hackattempts);
  1252.             DoHackShit;
  1253.       exit
  1254.     end;
  1255.     writelog (4,3,curboard.boardname+' ['+curboard.shortname+']');
  1256.     repeat
  1257.       q:=menu ('Message Bases Sponsor','SPONSOR','DLSTMWUEQRKCNBOVH!');
  1258.       case q of                                               (* |  |  *)
  1259.         1:getautodel;
  1260.         2:getblevel;
  1261.         3:setsponsor;
  1262.         4,5,6,16:writeln(^M^S'Function Removed.');
  1263.         7:setnameaccess;
  1264.         8:setallaccess;
  1265.         10:renameboard;
  1266.         11:killboard;
  1267.         12:sortboards;
  1268.         13:movebulletin;
  1269.         14:orderboards;
  1270.         15:listaccess;
  1271.         18:readfromtext;
  1272.         17:help ('Sponsor.Hlp');
  1273.       end
  1274.     until (q=9) or hungupon
  1275.   end;
  1276.  
  1277.   var beenaborted:boolean;
  1278.  
  1279.   function aborted:boolean;
  1280.   begin
  1281.     if beenaborted then begin
  1282.       aborted:=true;
  1283.       exit
  1284.     end;
  1285.     aborted:=xpressed or hungupon;
  1286.     if xpressed then begin
  1287.       beenaborted:=true;
  1288.       writeln (^B'Message Newscan Aborted!')
  1289.     end
  1290.   end;
  1291.  
  1292.   Function capfir(inString:STRING):char;
  1293.  begin
  1294.    capfir:=upcase(inString[1]);
  1295.  end;
  1296.  
  1297.  
  1298.   function forwardbackthread(search:lstr; forard:boolean):boolean;
  1299.   var Done:Boolean;
  1300.       old:word;
  1301.       cnt:integer;
  1302.  
  1303.       function matched(se:lstr):Boolean;
  1304.       Begin
  1305.         Matched:=Pos(Search,UpString(Se))>0;
  1306.       End;
  1307.  
  1308.       procedure stripsearch;
  1309.       Begin
  1310.         If pos(' [Reply',search)>0 then Search:=Copy(Search,1,pos(' [Reply',search)-1);
  1311.         Search:=UpString(Search);
  1312.       End;
  1313.  
  1314.       Begin
  1315.         StripSearch;
  1316.         Done:=False;
  1317.         Old:=CurBul;
  1318.         if forard then
  1319.             Repeat
  1320.               inc(curbul);
  1321.               getbrec;
  1322.               if matched(b.title) then done:=true;
  1323.             until Done or (curbul>=numbuls)
  1324.             else
  1325.              Repeat
  1326.                dec(curbul);
  1327.                getbrec;
  1328.                if matched(b.title) then done:=true;
  1329.              until done or (curbul<=1);
  1330.         if not done then curbul:=old;
  1331.         forwardbackthread:=done;
  1332.       end;
  1333.  
  1334.   procedure newscanboard;
  1335.  
  1336.     function getnumnum(title:lstr):integer;
  1337. var reprep      :byte;
  1338.     startpoint  :byte;
  1339.     endpoint    :byte;
  1340.     a           :string[1];
  1341. begin
  1342.    reprep    :=79;
  1343.    startpoint:=0;
  1344.    endpoint  :=0;
  1345.    getnumnum :=0;
  1346.   repeat
  1347.    a:=copy (title,reprep,1);
  1348.    if a='#' then
  1349.      begin;
  1350.        startpoint:=reprep;
  1351.          repeat
  1352.            if valu(copy(title,reprep,1))>0 then endpoint:=reprep;
  1353.            inc(reprep);
  1354.          until (reprep>=79);
  1355.      end;
  1356.    if (startpoint>0) and (endpoint>0) then
  1357.       begin
  1358.         dec(endpoint,startpoint);
  1359.         getnumnum:=valu(copy(title,startpoint+1,endpoint));
  1360.         exit;
  1361.       end;
  1362.     dec(reprep);
  1363.   until reprep<=0
  1364. end;
  1365.  
  1366. function gettitle(title:lstr;reply:word):lstr;
  1367. var search   :boolean;
  1368.     srcstr   :sstr;
  1369.     cursrc   :word;
  1370.     tit      :lstr;
  1371. begin
  1372.  
  1373.    srcstr  :=' [Reply #';
  1374.    search  :=false;
  1375.    tit     :='';
  1376.    cursrc  :=0;
  1377.  
  1378.    repeat
  1379.     if copy(title,cursrc,length(srcstr))=srcstr then
  1380.       begin;
  1381.         tit:=copy(title,1,cursrc-1);
  1382.         gettitle:=tit+' [Reply #'+strr(reply)+']';
  1383.         exit;
  1384.       end;
  1385.  
  1386.     if cursrc=79 then
  1387.       begin
  1388.         gettitle:=title+' [Reply #'+strr(reply)+']';
  1389.         exit;
  1390.       end;
  1391.     inc(cursrc);
  1392.    until cursrc=80;
  1393. end;
  1394.  
  1395.  
  1396.   var newmsgs,oldb:boolean;
  1397.       tt:text;
  1398.       q:anystr;
  1399.       wock:char;
  1400.       wock2:word;
  1401.       m,me:message;
  1402.       l,stonerslive,swash,kook:integer;
  1403.       t:sstr;
  1404.       fcpiskool:mstr;
  1405.       repnumber:word;
  1406.       lameo    :string;
  1407.   begin
  1408.     beenaborted:=false;
  1409.     newmsgs:=false;
  1410.     curbul:=lastreadnum+1;
  1411.     while curbul<=numbuls do begin
  1412.       getbrec;
  1413.         readnum (curbul);
  1414.         newmsgs:=true;
  1415.       repeat
  1416.        wock:='N';
  1417.        If (TimeLeft<1) and Not Local then
  1418.          Begin
  1419.             PrintFile(ConfigSet.TextFileDi+'TimesUp');
  1420.             ForceHangup:=True;
  1421.             Exit;
  1422.          End;
  1423.        writestr (^P'['^A'Newscanning '^R'- '+curboard.boardname+^P'] - ['^S+strr(curbul)+'/'+strr(numbuls)+^R' ?/Help'^P']:*');
  1424.        if length(input)<1 then input:='N';
  1425.        wock:=upcase(input[1]);
  1426.        wock2:=valu(input);
  1427.        if wock2>0 then begin
  1428.         if wock2<=numbuls then begin
  1429.          curbul:=wock2;
  1430.          readnum (curbul);
  1431.         end;
  1432.        end else
  1433.         wock:=upcase(wock);
  1434.         case wock of
  1435.         'F':If not forwardbackthread(b.title,true) then WriteLn(^M^G^S'No Forward thread found!')
  1436.             else
  1437.               Begin
  1438.                getbrec;
  1439.                readnum(curbul);
  1440.               end;
  1441.         'B':If not forwardbackthread(b.title,false) then WriteLn(^M^G^S'No backward thread found!')
  1442.             else
  1443.               Begin
  1444.                 GetBrec;
  1445.                 ReadNum(CurBul);
  1446.               End;
  1447.          '?':begin
  1448.               writeln;
  1449.               writeln (^S'                 -Newscan Help-'^R^M);
  1450.               writeln ('[N]: Next Message          [#]: Read that Message #');
  1451.               writeln ('[A]: Read Message Again    [R]: Reply to Message');
  1452.               writeln ('[D]: Delete Message        [P]: Post a Message');
  1453.               writeln ('[S]: Next Sub-board        [/]: Toggle Auto-Scan');
  1454.               writeln ('[B]: Backwards Thread      [F]: Forward thread');
  1455.               if (match(unam,b.leftby)) or (issysop) or (sponsoron)
  1456.               then write ('[E]: Edit Message          ');
  1457.               writeln ('[Q]: Quit Newscan');
  1458.               writeln;
  1459.              end;
  1460.                  'A':readcurbul;
  1461.                  'P':postbul;
  1462.          'D':begin
  1463.               reading:=true;
  1464.               killbul;
  1465.               curbul:=curbul-1;
  1466.               reading:=false;
  1467.              end;
  1468.          'R':begin
  1469.               if ulvl<configset.postleve then begin
  1470.                 reqlevel(configset.postleve);
  1471.                 exit
  1472.               end;
  1473.               okfortitle:=false;
  1474.               q:=b.leftby;
  1475.               if b.anon then q:=configset.anonymousst;
  1476.               lameo:=q;
  1477.               okfortitle:=false;
  1478.               l:=editor(m,false,true,q,b.title);
  1479.               okfortitle:=true;
  1480.               if l>=0 then
  1481.                 begin
  1482.                   inc(urec.nbu);
  1483.                   writeurec;
  1484.                   b.anon:=m.anon;
  1485.                   repnumber:=getnumnum(b.title);
  1486.                   inc(repnumber);
  1487.                   b.title:=gettitle(b.title,repnumber);
  1488.                   b.when:=now;
  1489.                   b.leftto:=lameo;
  1490.                   b.leftby:=unam;
  1491.                   b.status:='[ ha ]';
  1492.                   b.line:=l;
  1493.                   b.recieved:=false;
  1494.                   b.RealName:=Urec.RealName;
  1495.                   B.Cnet:=False;
  1496.                   b.Version:=NetMailVer;
  1497.                   B.FidoNet:=False;
  1498.                   B.Flag3:=False;
  1499.                   B.Flag4:=False;
  1500.                   B.Flag5:=False;
  1501.                   B.Flag6:=False;
  1502.                   B.Flag7:=False;
  1503.                   B.Flag8:=False;
  1504.                   b.where:=Configset.Origin1;
  1505.                   B.Where2:=Configset.origin2;
  1506.                   b.plevel:=ulvl;
  1507.                   addbul (b);
  1508.                   inc(newposts);
  1509.                   inc(gnup);
  1510.                    with curboard do
  1511.                     if autodel<=numbuls then begin
  1512.                       autodelete;
  1513.                       if curbul>5 then curbul:=curbul-5 else curbul:=1;
  1514.                       end;
  1515.                 end
  1516.              end;
  1517.          'E':begin
  1518.               if checkcurbul then begin
  1519.               if (not match(b.leftby,unam)) and (not issysop) and (not sponsoron)
  1520.                 then begin
  1521.                   writeln ('You didn''t post that!');
  1522.                 end
  1523.               else begin
  1524.               reloadtext (b.line,me);
  1525.               me.title:=b.title;
  1526.               me.anon:=b.anon;
  1527.               if reedit (me,true) then begin
  1528.                 writelog (4,6,b.title);
  1529.                 deletetext (b.line);
  1530.                 b.line:=maketext (me);
  1531.                 if b.line<0 then begin
  1532.                   writestr (^M'Deleting bulletin...');
  1533.                   delbul (curbul,false)
  1534.                 end else begin
  1535.                   seekbfile (curbul);
  1536.                   write (bfile,b)
  1537.                  end
  1538.                 end
  1539.                end;
  1540.               end;
  1541.              end;
  1542.          'S':exit;
  1543.          '/':togglecscan;
  1544.          'Q':begin
  1545.               quitmasterinc:=true;
  1546.               exit;
  1547.              end;
  1548.        end;
  1549.       until wock in ['N'];
  1550.       inc(curbul);
  1551.      if aborted then exit;
  1552.     end;
  1553.     if (postprompts in urec.config) and newmsgs and (ulvl>=configset.postleve)
  1554.       then begin
  1555.         okfortitle:=true;
  1556.         writestr (^M^P'Post on ['^S+curboard.boardname+^P'] '^F'(y/n)'^P'? *');
  1557.         writeln;
  1558.         if yes then postbul
  1559.       end
  1560.   end;
  1561.  
  1562.   procedure newscanall;
  1563.   var cb:integer;
  1564.   begin
  1565.     beenaborted:=false;
  1566.     writehdr ('New-Scanning Messages.  [X] will abort.');
  1567.     if aborted then exit;
  1568.     for cb:=0 to filesize(bdfile)-1 do begin
  1569.       if aborted then exit;
  1570.       if haveaccess(cb) and (not (cb in urec.newscanconfig)) then begin
  1571.         curboardname:=curboard.shortname;
  1572.         openbfile;
  1573.                 if aborted then exit;
  1574.                 clearscr;
  1575.                 writeln (^R'Scanning ['^S,curboard.boardname,^R']...'^M);
  1576.         if aborted then exit;
  1577.         newscanboard;
  1578.         if quitmasterinc then begin
  1579.          quitmasterinc:=false;
  1580.      writeln (^B^M'Newscan aborted!'^G);
  1581.      setfirstboard;
  1582.          exit;
  1583.         end
  1584.       end
  1585.     end;
  1586.     writeln (^B^M'Newscan complete!'^G);
  1587.     setfirstboard
  1588.   end;
  1589.  
  1590.   procedure noboards;
  1591.   begin
  1592.     writeln ('No sub-boards exist!');
  1593.     if not issysop then exit;
  1594.     writestr ('Create the first sub-board now [y/n]? *');
  1595.     if not yes then exit;
  1596.     writestr ('Enter its access name/number:');
  1597.     if not validbname(input) then writeln (^B'Invalid board name!') else begin
  1598.       curboardname:=input;
  1599.       makeboard
  1600.     end
  1601.   end;
  1602.  
  1603.   procedure togglenewscan;
  1604.   begin
  1605.     write ('Newscan this board: ');
  1606.     if curboardnum in urec.newscanconfig
  1607.       then
  1608.         begin
  1609.           writeln ('Yes');
  1610.           urec.newscanconfig:=urec.newscanconfig-[curboardnum]
  1611.         end
  1612.       else
  1613.         begin
  1614.           writeln ('No');
  1615.           urec.newscanconfig:=urec.newscanconfig+[curboardnum]
  1616.         end
  1617.   end;
  1618.  
  1619.   procedure nextsubboard;
  1620.   var cb:integer;
  1621.       obn:sstr;
  1622.   begin
  1623.     obn:=curboardname;
  1624.     cb:=curboardnum;
  1625.     while cb<filesize(bdfile)-1 do begin
  1626.       inc(cb);
  1627.       if haveaccess (cb) then begin
  1628.         seek (bifile,cb);
  1629.         read (bifile,obn);
  1630.         setactive (obn);
  1631.         exit
  1632.       end
  1633.     end;
  1634.     writestr ('This is the last sub-board!');
  1635.     setactive (obn)
  1636.   end;
  1637.  
  1638.   procedure listusersaxis;
  1639.  
  1640.       procedure listacc (all:boolean);
  1641.       var cnt:integer;
  1642.           a:accesstype;
  1643.           u:userrec;
  1644.  
  1645.       begin
  1646.         seek (ufile,1);
  1647.         for cnt:=1 to numusers do begin
  1648.           read (ufile,u);
  1649.           If Curboard.Conference=0 then Begin
  1650.           a:=getuseraccflag (u,curboardnum);
  1651.           case a of
  1652.             letin:writeln (^S,u.handle,^R);
  1653.             bylevel:if u.level>=curboard.level then writeln (^S,u.handle,^R);
  1654.           end;
  1655.           end else if U.ConfSet[CurBoard.Conference]>0 then WriteLn(^S,u.Handle,^R);
  1656.           if break then exit
  1657.         end
  1658.       end;
  1659.  
  1660.     begin
  1661.      writehdr ('List Users with Board Access');
  1662.      writeln;
  1663.      writeln (^R'Users with access to ['^S+curboard.boardname+^R']:');
  1664.      writeln;
  1665.      listacc (true);
  1666.     end;
  1667.  
  1668.  
  1669.   procedure readsboard(msgfrm,msgto:integer);
  1670.  
  1671.     function getnumnum(title:lstr):integer;
  1672. var reprep      :byte;
  1673.     startpoint  :byte;
  1674.     endpoint    :byte;
  1675.     a           :string[1];
  1676. begin
  1677.    reprep    :=79;
  1678.    startpoint:=0;
  1679.    endpoint  :=0;
  1680.    getnumnum :=0;
  1681.   repeat
  1682.    a:=copy (title,reprep,1);
  1683.    if a='#' then
  1684.      begin;
  1685.        startpoint:=reprep;
  1686.          repeat
  1687.            if valu(copy(title,reprep,1))>0 then endpoint:=reprep;
  1688.            inc(reprep);
  1689.          until (reprep>=79);
  1690.      end;
  1691.    if (startpoint>0) and (endpoint>0) then
  1692.       begin
  1693.         dec(endpoint,startpoint);
  1694.         getnumnum:=valu(copy(title,startpoint+1,endpoint));
  1695.         exit;
  1696.       end;
  1697.     dec(reprep);
  1698.   until reprep<=0
  1699. end;
  1700.  
  1701. function gettitle(title:lstr;reply:word):lstr;
  1702. var search   :boolean;
  1703.     srcstr   :sstr;
  1704.     cursrc   :word;
  1705.     tit      :lstr;
  1706. begin
  1707.  
  1708.    srcstr  :=' [Reply #';
  1709.    search  :=false;
  1710.    tit     :='';
  1711.    cursrc  :=0;
  1712.  
  1713.    repeat
  1714.     if copy(title,cursrc,length(srcstr))=srcstr then
  1715.       begin;
  1716.         tit:=copy(title,1,cursrc-1);
  1717.         gettitle:=tit+' [Reply #'+strr(reply)+']';
  1718.         exit;
  1719.       end;
  1720.  
  1721.     if cursrc=79 then
  1722.       begin
  1723.         gettitle:=title+' [Reply #'+strr(reply)+']';
  1724.         exit;
  1725.       end;
  1726.     inc(cursrc);
  1727.    until cursrc=80;
  1728. end;
  1729.  
  1730.   var newmsgs,oldb:boolean;
  1731.       wacko:word;
  1732.       q:anystr;
  1733.       wock:char;
  1734.       wock2:word;
  1735.       m,me:message;
  1736.       l,lsdrule,stonerslive,swash:integer;
  1737.       t:sstr;
  1738.       fcpiskool:mstr;
  1739.       repnumber:word;
  1740.       lameo    :string;
  1741.   begin
  1742.   curbul:=msgfrm;
  1743.   wacko:=urec.lastread[curboardnum+(50*(CurrentConference-1))];
  1744.   for lsdrule:=msgfrm to msgto do begin
  1745.     beenaborted:=false;
  1746.     newmsgs:=false;
  1747.     while curbul<=numbuls do begin
  1748.       getbrec;
  1749.         readnum (curbul);
  1750.         newmsgs:=true;
  1751.       repeat
  1752.        wock:='N';
  1753.        If (TimeLeft<1) and Not Local then
  1754.         Begin
  1755.          PrintFile(ConfigSet.TextFileDi+'TimesUp');
  1756.          ForceHangup:=True;
  1757.          Exit;
  1758.         End;
  1759.        WriteStr(^R'['^S'Message Reading - '^F+curboard.boardname+^R'] - ['^A'?/Help'^R']'^P' :*');
  1760.        if length(input)<1 then input:='N';
  1761.        wock:=upcase(input[1]);
  1762.        wock2:=valu(input);
  1763.        if wock2>0 then begin
  1764.         if wock2<=numbuls then begin
  1765.          curbul:=wock2;
  1766.          readnum (curbul);
  1767.         end;
  1768.        end else
  1769.         wock:=upcase(wock);
  1770.         case wock of
  1771.          'B':if not forwardbackthread(b.title,false) then WriteLn(^M^G^S'No backwards thread found!')
  1772.              else Begin
  1773.              getbrec;
  1774.              readnum(curbul);
  1775.              end;
  1776.          'F':If not forwardbackthread(b.title,true) then writeln(^M^G^S'No Forward thread found!')
  1777.              Else Begin
  1778.              GetBrec;
  1779.              ReadNum(Curbul);
  1780.              End;
  1781.          '?':begin
  1782.               writeln;
  1783.               writeln (^S'             ■ Message Read Help ■'^R^M);
  1784.               writeln ('[N] Next Message          [#] Read that Message #');
  1785.               writeln ('[A] Read Message Again    [R] Reply to Message');
  1786.               writeln ('[D] Delete Message        [P] Post a Message');
  1787.               writeln ('[B] Backwards Thread      [F] Forwards Thread');
  1788.               writeln ('[S] Next Sub-board        [/] Toggle Auto-Scan');
  1789.               if (match(unam,b.leftby)) or (issysop) or (sponsoron)
  1790.               then write ('[E]: Edit Message          ');
  1791.               writeln ('[Q]: Quit Newscan');
  1792.               writeln;
  1793.              end;
  1794.                  'A':ReadCurBul;
  1795.                  'P':begin
  1796.               postbul;
  1797.              end;
  1798.          'D':begin
  1799.               reading:=true;
  1800.               killbul;
  1801.               curbul:=curbul-1;
  1802.               reading:=false;
  1803.              end;
  1804.          'R':begin
  1805.               if ulvl<configset.postleve then begin
  1806.                 reqlevel(configset.postleve);
  1807.                 exit
  1808.               end;
  1809.               q:=b.leftby;
  1810.               if b.anon then q:=configset.anonymousst;
  1811.               lameo:=q;
  1812.               okfortitle:=False;
  1813.               l:=editor(m,false,true,q,b.title);
  1814.               if l>=0 then
  1815.                 begin
  1816.                   inc(urec.nbu);
  1817.                   writeurec;
  1818.                   b.anon:=m.anon;
  1819.                   repnumber:=getnumnum(b.title);
  1820.                   inc(repnumber);
  1821.                   b.title:=gettitle(b.title,repnumber);
  1822.                   b.when:=now;
  1823.                   b.leftto:=lameo;
  1824.                   b.leftby:=unam;
  1825.                   b.status:='[ ha ]';
  1826.                   b.line:=l;
  1827.                   b.recieved:=false;
  1828.                   b.plevel:=ulvl;
  1829.                   b.RealName:=Urec.RealName;
  1830.                   B.where:=Configset.Origin1;
  1831.                   B.Where2:=Configset.Origin2;
  1832.                   b.Cnet:=False;
  1833.                   B.FidoNet:=False;
  1834.                   B.Flag3:=False;
  1835.                   B.Flag4:=False;
  1836.                   b.Flag5:=False;
  1837.                   B.Flag6:=False;
  1838.                   B.Flag7:=False;
  1839.                   B.Flag8:=False;
  1840.                   B.Version:=NetMailVer;
  1841.                   addbul (b);
  1842.                   inc(newposts);
  1843.                   inc(gnup);
  1844.                    with curboard do
  1845.                     if autodel<=numbuls then begin
  1846.                       autodelete;
  1847.                       if curbul>5 then curbul:=curbul-5 else curbul:=1;
  1848.                       end;
  1849.                 end
  1850.              end;
  1851.          'E':begin
  1852.               if checkcurbul then begin
  1853.               if (not match(b.leftby,unam)) and (not issysop) and (not sponsoron)
  1854.                 then begin
  1855.                   writeln ('You didn''t post that!');
  1856.                 end
  1857.               else begin
  1858.               reloadtext (b.line,me);
  1859.               me.title:=b.title;
  1860.               me.anon:=b.anon;
  1861.               if reedit (me,true) then begin
  1862.                 writelog (4,6,b.title);
  1863.                 deletetext (b.line);
  1864.                 b.line:=maketext (me);
  1865.                 if b.line<0 then begin
  1866.                   writestr (^M'Deleting bulletin...');
  1867.                   delbul (curbul,false)
  1868.                 end else begin
  1869.                   seekbfile (curbul);
  1870.                   write (bfile,b)
  1871.                  end
  1872.                 end
  1873.                end;
  1874.               end;
  1875.              end;
  1876.          'S':begin
  1877.              If Urec.LastRead[CurBoardNum+(50*(CurrentConference-1))]<=Wacko then
  1878.              urec.lastread[curboardnum+(50*(CurrentConference-1))]:=wacko;
  1879.              exit;
  1880.              end;
  1881.          '/':togglecscan;
  1882.          'Q':begin
  1883.             If Urec.LastRead[CurboardNum+(50*(CurrentConference-1))]<=Wacko then
  1884.              urec.lastread[curboardnum+(50*(CurrentConference-1))]:=wacko;
  1885.              exit;
  1886.              end;
  1887.        end;
  1888.       until wock in ['N'];
  1889.       inc(curbul);
  1890.       if (curbul>msgto) or aborted then begin
  1891.         If Urec.LastRead[Curboardnum+(50*(CurrentConference-1))]<=Wacko then
  1892.         urec.lastread[curboardnum+(50*(CurrentConference-1))]:=wacko;
  1893.         exit;
  1894.         end;
  1895.     end;
  1896.       end;
  1897.       If Urec.LastRead[CurboardNum+(50*(CurrentConference-1))]<=Wacko then
  1898.       urec.lastread[curboardnum+(50*(CurrentConference-1))]:=wacko;
  1899.   end;
  1900.  
  1901. procedure readfromtext;
  1902. var fname,lt:lstr;
  1903.     tit,tu:mstr;
  1904.     lne:integer;
  1905.     fnt:text;
  1906.     m:message;
  1907.     b:bulrec;
  1908. begin
  1909. writestr(^M'Enter the filename to read text from : *');
  1910.        if input='' then exit;
  1911.        fname:=input;
  1912.        if not exist(fname) then begin
  1913.           writeln(^M^G'Sorry, that file does not exist!');
  1914.           exit;
  1915.        end;
  1916.        writestr('Enter the subject [Return Aborts this]: *');
  1917.        if input='' then exit;
  1918.        tit:=input;
  1919.        writestr('Send to [CR/All]: *');
  1920.        if input='' then input:='All';
  1921.        tu:=input;
  1922.        writeln(^M'Reading text..');
  1923.        assign(fnt,fname);
  1924.        reset(fnt); lne:=0;
  1925.        while (not eof(fnt) and (lne<99)) do begin
  1926.          readln(fnt,lt);
  1927.          inc(lne);
  1928.          m.text[lne]:=lt;
  1929.        end;
  1930.        writeln(^M'Writing text...');
  1931.        m.numlines:=lne;
  1932.        m.anon:=false;
  1933.        m.title:=tit;
  1934.        m.sendto:=tu;
  1935.        b.Cnet:=False;
  1936.        b.FidoNet:=False;
  1937.        b.Flag3:=False;
  1938.        b.Flag4:=False;
  1939.        b.Flag5:=False;
  1940.        b.Flag6:=False;
  1941.        b.Flag7:=False;
  1942.        b.Flag8:=False;
  1943.        b.Where:=Configset.Origin1;
  1944.        B.Where2:=Configset.Origin2;
  1945.        b.Version:=NetMailVer;
  1946.        b.Realname:=urec.RealName;
  1947.        m.note:=urec.usernote;
  1948.        lne:=maketext(m);
  1949.        b.anon:=false;
  1950.        b.title:=tit;
  1951.        b.when:=now;
  1952.        b.leftby:=unam;
  1953.        b.status:='[ ha ]';
  1954.        b.recieved:=false;
  1955.        b.leftto:=tu;
  1956.        b.line:=lne;
  1957.        b.plevel:=ulvl;
  1958.        addbul(b);
  1959.        inc(newposts);
  1960.        inc(gnup);
  1961.        with curboard do if autodel<=numbuls then autodelete;
  1962. end;
  1963.  
  1964.     Procedure yourudstatus;
  1965.     var newmessages:longint;
  1966.         Begin
  1967.             mens:=true;
  1968.             nobreak:=false;
  1969.             dontstop:=true;
  1970.             Ansicolor(Urec.StatusBoxColor);
  1971.             Boxit(5,40,29,9);
  1972.             FuckXy(6,41,^S'     Post/Call Ratio  '^M);
  1973.             FuckXy(7,42,^P'Posts    : '^S+Strr(Urec.Nbu)+^M);
  1974.             FuckXy(8,42,^P'Calls    : '^S+Strr(Urec.NumOn)+^M);
  1975.             FuckXy(9,42,^P'Ratio    : '^S+Strr(Ratio(Urec.Nbu,Urec.NumOn))+^M);
  1976.             FuckXy(10,42,^P'Minimum  : '^S+Strr(Urec.PCRatio)+^M);
  1977.             FuckXy(11,42,^P'Status   : '^S);
  1978.             If Ulvl>ConfigSet.ExemptPc then WriteLn('Exempt')
  1979.                 else if ratio(urec.nbu,urec.numon)<urec.pcratio then WriteLn('Bad!') else WriteLn('Passed');
  1980.             FuckXy(12,42,^P'New Msgs : '^S);
  1981.             newmessages:=gnup-conpostsa;
  1982.             if newmessages>0 then writeln(newmessages) else writeln('None');
  1983.                 clearbreak;
  1984.             end;
  1985.  
  1986. var boo:boolean;
  1987.     msgfrom,msgto:integer;
  1988. label exit;
  1989. begin
  1990.   cursection:=bulletinsysop;
  1991.   reading:=false;
  1992.   quitmasterinc:=false;
  1993.   cscan:=false;
  1994.   openbdfile;
  1995.   if filesize(bdfile)=0 then begin
  1996.     noboards;
  1997.     if filesize(bdfile)=0 then begin
  1998.       closebdfile;
  1999.       goto exit
  2000.     end
  2001.   end;
  2002.   if not haveaccess(0)
  2003.     then
  2004.       begin
  2005.         writeln (^B'You do not have access to the first sub-board!');
  2006.         closebdfile;
  2007.         goto exit
  2008.       end;
  2009.       clearscr;
  2010.        topten(1);
  2011.        setfirstboard;
  2012.        If (urec.msgheader<1) or (urec.msgheader>2) Then GetYaHeader;
  2013.   if configset.shownewprompts then begin
  2014.   WriteStr(^M^M^P'Scan for new messages? '^F'['^A'N'^F']'^P':');
  2015.   If Yes then NewScanAll;
  2016.   end;
  2017.   PrintXy(15,0,'');
  2018.   okfortitle:=true;
  2019.   repeat
  2020.     boo:=checkcurbul;
  2021.     with curboard do
  2022.       writeln (^M^R,boardname,' ['^S,shortname,^R'] '^S,curbul,^R' of '^S,numbuls,^R);
  2023. (*    if sponsoron or issysop
  2024.       then writeln (^R'['^S'%'^R']:Board Sponsor Commands'); *)
  2025.       q:=menu (^R'('^S+curboard.shortname+^R') Message','BULLET','PRDFUKT*MQ#_%LNBAVCHES+WG/!');
  2026.     case q of
  2027.       1:Begin okfortitle:=true; postbul; end;
  2028.       2:begin
  2029.         thereare(numbuls,'Messages','msgs');
  2030.         parserange(numbuls,msgfrom,msgto);
  2031.         readsboard(msgfrom,msgto);
  2032.       end;
  2033.       4,22:sendmailto (curboard.sponsor,false);
  2034.       5:uploadfile;
  2035.       3,6:killbul;
  2036.       8,16,17:activeboard;
  2037.       7:listbuls;
  2038.       9:sendbreply;
  2039.       12:if not hungupon then readnextbul;
  2040.       13:boardsponsor;
  2041.       14:ListUsersAxis;
  2042.       15:newscanall;
  2043.       18:newscanboard;
  2044.       19:togglenewscan;
  2045.       20:help ('Message.hlp');
  2046.       21:editbul;
  2047.       23:nextsubboard;
  2048.       24:readnum (lastreadnum+1);
  2049.       25:offtheforum;
  2050.       26:togglecscan;
  2051.       27:getyaheader
  2052.      else if q<0 then readnum (-q)
  2053.     end
  2054.   until (q=10) or hungupon or (filesize(bdfile)=0);
  2055.   okfortitle:=true;
  2056.   exit:
  2057.   close (bfile);
  2058.   closebdfile
  2059. end;
  2060.  
  2061. begin
  2062. end.
  2063.